'''
Created on 2009-02-24

@author: belleyma
'''
import os
import string
from tkinter import *

print ("Hoo hoo World")
x = "Bonjour"
print(x.upper())

class Application(Frame):
    def say_hi(self):
        print("hi there, everyone!")

    def setLabelValue(self):
        self.v.__del__()
        str = "The key is {0} and value is {1} \n" 
        for k, v in os.environ.items():
            #print (str.format(k,v))
            self.v.set(self.v.get() + str.format(k,v))
            
        #if (self.v.get() == "Rouge"):
        #    self.v.set("test")
        #else:
        #   self.v.set("Rouge")

    def createWidgets(self):
        self.QUIT = Button(self)#.grid(row=1, column=1)
        self.QUIT["text"] = "QUIT"
        self.QUIT["fg"]   = "red"
        self.QUIT["command"] =  self.quit

        self.QUIT.pack({"side": "left"})

        self.hi_there = Button(self)#.grid(row=1, column=0)
        self.hi_there["text"] = "Hello",
        self.hi_there["command"] = self.setLabelValue
        
        self.hi_there.pack({"side": "left"})
        self.v = StringVar()
        self.v.set("Rouge")
        self.lbl = Label(self, textvariable=self.v, fg="red",
                         justify=LEFT,wraplength=400,relief=GROOVE,
                         anchor=NW)#.grid(row=0, column=0)
        self.lbl.pack({"side": "left"})

    def __init__(self, master=None):
        Frame.__init__(self, master)
        self.pack()
        self.createWidgets()

root = Tk()
app = Application(master=root)
app.mainloop()
root.destroy()